/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package formularios;

import java.awt.event.KeyEvent;
import javax.swing.JTextField;

/**
 *
 * @author Ramon
 */
public class MoedaTextField extends JTextField {






    @Override
    protected void processKeyEvent(KeyEvent e) {

        if (e.getID() == KeyEvent.KEY_TYPED) {

            String cadeia = "0123456789.,";

            if (cadeia.indexOf(e.getKeyChar()) == -1) {
                e.consume();
                return;
            }
        }
        super.processKeyEvent(e);
    }
}
